package hd.cls4;

import hd.Dog;

import java.util.Arrays;

/**
*基本类型：byte,short,int,long,float,double,char,boolean
 * 引用类型：String,数组，类，接口
 */
public class StrTest {
    public static void main(String[] args) {
        String str="梦幻哥哥是个big帅哥";
        String s2=str;
        str="老刘是个帅哥";
        System.out.println(s2);
        byte[] b1 = s2.getBytes();
        System.out.println(Arrays.toString(b1));
        char[] cr = s2.toCharArray();
        System.out.println(Arrays.toString(cr));
        int pos = s2.indexOf("梦幻",5);
        //boolean b=s2.contains("")
        System.out.println(pos);
        String s3="    大数据22 班      ";
        System.out.println(s3.length());
        s3=s3.trim();
        System.out.println(s3.length());
        System.out.println(s3);
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        String s4="顶梦幻21老刘29朱蓉20赵政治17张梓旭20";
        String[] arr=s4.split("\\d+");
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        //s4=s4.replaceAll("\\d+","");
        s4=s4.replaceAll("[\\u4e00-\\u9fa5]+","*");
        System.out.println(s4);

//        int i=0x100;
//        int j=i;
//        i=0x99;
//        System.out.println(i+","+j);
//
//        Dog d=new Dog();
//        d.setName("二花");
//        Dog d2=d;
//        Dog d3=d;
//        d3.setName("刀疤黄");
//        d.eat();
    }
}
